package org.sepheriel.airy2d.utils;

import java.util.Calendar;

import org.lwjgl.Sys;

public class Utils {
	
	public static void dump(String _msg, int _type)
	{
		switch(_type)
		{
		/** informations */
		case 1:
			System.out.println("INFORMATION: "+getSystemTime()+": "+_msg);
			break;
		/** warnings */
		case 2:
			System.out.println("WARNING: "+getSystemTime()+": "+_msg);
			break;
		/** errors */
		case 3:
			System.out.println("ERROR: "+getSystemTime()+": "+_msg);
			break;
		}
	}
	
	public static String getSystemTime() {
        String timeString = new String();

        Calendar date = Calendar.getInstance();

        int hours = date.get(Calendar.HOUR_OF_DAY);
        int minutes = date.get(Calendar.MINUTE);
        int seconds = date.get(Calendar.SECOND);

        if (hours < 10) {
            timeString += "0";
        }
        timeString += hours + ":";

        if (minutes < 10) {
            timeString += "0";
        }
        timeString += minutes + ":";

        if (seconds < 10) {
            timeString += "0";
        }
        timeString += seconds;

        return timeString;
    }


}
